// Created by Joe on 2017/7/21.

app.service(
    'NewsService',
    [
        'config', 'RequestProxyService',
        function (config, RequestProxyService) {
            return {
                getNewsType: RequestProxyService.requestProxy('/news/getNewsType', {},
                    {newsTab: ''},
                    function (resolve, info) {
                        resolve(info.result);
                    }, 'user'),
                getNewsList: function (type, id) {
                    return RequestProxyService.requestProxy('/news/list', {},
                        {type: type, cityCode: config.curCity.cityCode},
                        function (resolve, info) {
                            resolve({id: id, info: info});
                        }, 'user')();
                }
            };
        }
    ]
);